package com.acwer.drgs.performance.es.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;
import org.springframework.data.elasticsearch.core.join.JoinField;

@Data
@Document(indexName = "perfmdic",replicas = 0)
@ApiModel(value = "绩效字典",description = "如：医疗付款方式代码、国籍代码")
public class PerfmDic {

    @ApiModelProperty("主键")
    @Id
    private String id;

    @ApiModelProperty("字典编码")
    private String code;


//    @Field(type = FieldType.Keyword)
//    private String routing;

    @ApiModelProperty(value = "父子关系字段",notes = "父类用join.name='p'；子类join.name='c',join.parent=父类ID")
    @JoinTypeRelations(
            relations =
                    {
                            @JoinTypeRelation(parent = "p", children = "c")
                    }
    )
    private JoinField<String> join;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("值")
    private String val;

    @ApiModelProperty("备注")
    private String mark;
    @ApiModelProperty(value = "停用/启用",notes = "true:启用(默认）,false:停用")
    private Boolean enable=true;
}
